﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Abp.AutoMapper;
using Abp.Runtime.Validation;
using Abp.Extensions;
using LeadThing.AbpZeroTemplate.LawsRegulationses;
using static LeadThing.AbpZeroTemplate.Configuration.AppSettings;

namespace LeadThing.AbpZeroTemplate.LawsRegulationses.Dtos
{
    /// <summary>
    /// 法律法规表编辑用Dto
    /// </summary>
    [AutoMap(typeof(LawsRegulations))]
    public class LawsRegulationsAPPEditDto
    {
        private string _CreationTime;

        /// <summary>
        ///   主键Id
        /// </summary>
        [DisplayName("主键Id")]
        public long? Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [DisplayName("标题")]
        [Required]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [DisplayName("内容")]
        public string Content { get; set; }

        /// <summary>
        /// 文件ID
        /// </summary>
        [DisplayName("文件ID")]
        public int FileID { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        public string CreationTime
        {
            get
            {
                return _CreationTime;
            }
            set
            {
                _CreationTime = AppSetting.ConvertIntDatetime(Convert.ToDateTime(value)).ToString();
            }
        }

        #region 扩展字段

        /// <summary>
        /// 图片封面
        /// </summary>
        [DisplayName("图片封面")]
        public string ImgUrl { get; set; }

        #endregion

    }
}
